﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Sdk.WeiXin.Domain.pay
{
    /// <summary>
    /// 分账接收方
    /// </summary>
    public class SharingReceiverBase
    {
        /// <summary>
        /// MERCHANT_ID：商户ID
        /// PERSONAL_WECHATID：个人微信号
        /// PERSONAL_OPENID：个人openid（由父商户APPID转换得到）
        /// PERSONAL_SUB_OPENID: 个人sub_openid（由子商户APPID转换得到）
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// 分账接收方帐号
        /// </summary>
        public string account { get; set; }
        /// <summary>
        /// 分账金额，单位为分，不能超过原订单支付金额及最大分账比例金额
        /// </summary>
        public int amount { get; set; }
        /// <summary>
        /// 分账描述
        /// </summary>
        public string description { get; set; }
    }

    public class SharingReceiver : SharingReceiverBase
    {
        public SharingReceiver() { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="amount">分账金额,单位为分</param>
        /// <param name="account">收款方帐号</param>
        /// <param name="description">描述</param>
        public SharingReceiver(int amount, string account, string nickname, string description)
        {
            this.account = account;
            this.amount = amount;
            this.description = description;
            this.nickname = nickname;
            type = "PERSONAL_OPENID";
            //name = "";
        }
       
       // public string name { get; set; }
        /// <summary>
        /// 与分账方的关系：
        /// SERVICE_PROVIDER：服务商
        /// STORE：门店
        /// STAFF：员工
        /// STORE_OWNER：店主
        /// PARTNER：合作伙伴
        /// HEADQUARTER：总部
        /// BRAND：品牌方
        /// DISTRIBUTOR：分销商
        /// USER：用户
        /// SUPPLIER：供应商
        /// CUSTOM：自定义
        /// </summary>
        public string relation_type { get; set; } = "PARTNER";

        /// <summary>
        /// 自定义名称，方便显示
        /// </summary>
        public string nickname { get; set; }
    }

}
